require('dotenv').config();

const headers = {
  "X-Access-Token": process.env.ACCESS_TOKEN,
  accept: "application/json, text/plain, */*"
};

const baseUrl = process.env.BASE_URL;
const fileConfig = {
  base: process.env.OUTPUT_BASE_PATH || './src/data-view/',
  suffix: '.server.js'
}

module.exports = {
  list: [
    {
      name: "payChannel",
      api: {
        url: `${baseUrl}/park/payChannel/queryList`,
        method: "GET",
        headers
      },
      outputFile: {
        path: `${fileConfig.base}/payChannel${fileConfig.suffix}`, // 前端项目的地址， 文件尾以.server.js结尾
        format: data =>
          `// AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY\n\n // 自动生成的文档，请勿直接编辑\n\n export default ${JSON.stringify(
            data,
            null,
            2
          )}`
      },
      versionCheck: true
    }
  ],

  // 同步间隔 (毫秒)
  syncInterval: 60 * 60 * 1000, // 1小时
};
